<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
    <img id="icon" src="img/img_01.jpg">
    <p id="word">1111</p>
    <p></p>
    <button id="btn">隐藏</button>
    <script>
        var img = document.getElementById('icon');
        var P = document.getElementById('word');
        var btn = document.getElementById('btn');

        btn.onclick = function(){
            if(btn.innerHTML == '隐藏'){
                btn.innerHTML = '显示';
                img.style.display = 'none';
                p.style.display = 'none'
            }else{
                //innerHTML 标签的内容 隐藏  outerHTML拿到整个标签
                btn.innerHTML = '隐藏';
                img.style.display = 'inline-block';
                p.style.display = 'block'
            }

        }


    </script>

</body>
</html>